//TODO: work around;
function DisplayBlock(){
	var ScritpArray=[];
	ScritpArray.push("/js/POS/PosTableBlock/PosTableBlock.js");
	ScritpArray.push("/js/POS/TapContent/TapContent.js");
	CheckAllScript(ScritpArray,function(){PosDisplyDetail()},null);
}
function PosDisplyDetail(){
	DisplayTapContent();
	losResTable();
	$('[name=POS_title]').text(SharedData.posTitle);
}

function OpenPosmenuList(){
	var col = $('[name=elmTable]').parents('tr').last().children('td').size();
	if($('[name=leftMenu]').css('display')!="none"){
		$('[name=Block]').css('margin-left','0px');
		$('[name=leftMenu]').css('display','none');
		DrawTablebymenu(col+1);
	}else{
		$('[name=Block]').css('margin-left','218px');
		$('[name=leftMenu]').attr('class',"leftMenuList");
		$('[name=leftMenu]').show();
		DrawTablebymenu(col-1);
	}
}

function OpenPosTaskList(){
	var col = $('[name=elmTable]').parents('tr').last().children('td').size();
	if($('.taskListbody').height()<559){
		$('.taskListbody').css('height',426+'px');
	}else{
		$('.taskListbody').css('height',$('[name=Block]').height()-133+'px');
	}
	
	if($('[name=taskList]').css('display')!="none"){
		$('[name=Block]').css('margin-right','0px');
		$('[name=taskList]').css('display','none');
		DrawTablebymenu(col+1);
	
	}else{
		$('[name=Block]').css('margin-right','218px');
		$('[name=taskList]').attr('class',"tasklist");
		$('[name=taskList]').show();
		DrawTablebymenu(col-1);
	}
}

function openOrderListPage(posresid)//(dom)
{
	waitingDialog();
	var ScritpArray=[];
	ScritpArray.push("/js/POS/OrderItem/OrderItem.js");
	ScritpArray.push("/js/POS/ConfirmOrderPage/ConfirmOrderPage.js");
	CheckAllScript(ScritpArray,function(posresid){
		var tableId = getObjectFromDataIndex(SharedData.POSReservationTable,"id",posresid).tableId;
		simpleserviceWithArgs("/POSgenerateOrderService",{func:"GetPOSOrderList",gtableid:posresid},function(data,obj){
			var objArray = JSON.parse(data);
			var tab = SelectTab(obj.tableId,null,false);
			tab.posresid = obj.posresid;
			tab.pagetitle = "orderlist";
			tab.OrderList = objArray;
			switchTab($("#tabs [table="+tab.table.id+"]"));
			for(var i=0;i<tab.OrderList.length;i++)
				for(var j=0;j<tab.OrderList[i].items.length;j++)
					tab.OrderList[i].items[j].refItem = getObjectFromSharedData(SharedData.Item,getCurrentTable().OrderList[i].items[j].item);
			closeWaitingDialog();
		},{tableId:tableId,posresid:posresid});
	},posresid);
}
